<template>
  <div>
    <!-- 资源管理 -->
    <el-card>
      <div slot="header">
        <el-button size="mini" type="warning" >初始化菜单</el-button>
        <el-button size="mini" type="primary" >新增菜单</el-button>
      </div>

        <el-table
          :data="list"
          style="width: 100%;margin-bottom: 20px;"
          row-key="id"
          border
          :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
          <el-table-column
            prop="title"
            label="菜单名称"
            width="180">
          </el-table-column>

          <el-table-column
            label="图标"
            width="180">
            <template slot-scope="scope">
              <i :class="scope.row.icon"></i>
            </template>
          </el-table-column>

          <el-table-column
            prop="level"
            label="等级"
            width="180">
          </el-table-column>

          <el-table-column
            prop="sort"
            label="排序"
            width="180">
          </el-table-column>

          <el-table-column
            prop="permissionValue"
            label="权限标识"
            width="180">
          </el-table-column>

          <el-table-column
            prop="path"
            label="路由"
            width="180">
          </el-table-column>

          <el-table-column
            prop="component"
            label="组建路径"
            width="180">
          </el-table-column>

          <el-table-column
            prop="status"
            label="是否可用"
            width="180">
          </el-table-column>

          <el-table-column
            prop="createTime"
            label="创建时间"
            width="180">
          </el-table-column>



        </el-table>

    </el-card>
  </div>
</template>

<script>
import {findAllPermissions} from '@/api/authority/resource';
export default {
  data(){
    return{
      //获取所有菜单
      list:[],
    }
  },
  created(){
    this.getData()
  },
  methods:{
    //获取所有菜单
    getData(){
      findAllPermissions().then(res=>{
        console.log(res);
        this.list=res.data.menus
      })
    }
  }
}
</script>

<style lang="scss" scoped>

</style>